![]() |
Kinetis SDK API Reference Manual
1.0.0-beta
Freescale Semiconductor, Inc.
|
The section describes the programming interface of the WDOG HAL driver. More...
Typedefs | |
| typedef void(* | wdog_isr_callback_t )(void) |
| Watchdog ISR callback function type. | |
Enumerations | |
| enum | wdog_clock_source_t { kWdogDedicatedClock = 0, kWdogAlternateClock = 1 } |
| Watchdog clock source selection. More... | |
| enum | wdog_clock_prescaler_t { kWdogClockPrescaler1 = 0, kWdogClockPrescaler2 = 1, kWdogClockPrescaler3 = 2, kWdogClockPrescaler4 = 3, kWdogClockPrescaler5 = 4, kWdogClockPrescaler6 = 5, kWdogClockPrescaler7 = 6, kWdogClockPrescaler8 = 7 } |
| Define the selection of the clock prescaler. More... | |
Watchdog HAL. | |
| void | wdog_hal_enable (void) |
| Enable watchdog module. More... | |
| void | wdog_hal_disable (void) |
| Disable watchdog module. More... | |
| static bool | wdog_hal_is_enabled (void) |
| Check whether WDOG is enabled. More... | |
| void | wdog_hal_configure_interrupt (bool isEnabled) |
| Enable and disable watchdog interrupt. More... | |
| static bool | wdog_hal_is_interrupt_enabled (void) |
| Check whether WDOG interrupt is enabled. More... | |
| void | wdog_hal_set_clock_source (wdog_clock_source_t clockSource) |
| set watchdog clock Source. More... | |
| static wdog_clock_source_t | wdog_hal_get_clock_source (void) |
| Get watchdog clock Source. More... | |
| void | wdog_hal_configure_window_mode (bool isEnabled) |
| Enable and disable watchdog window mode. More... | |
| static bool | wdog_hal_is_window_mode_enabled (void) |
| Check whether window mode is enabled. More... | |
| void | wdog_hal_configure_register_update (bool isEnabled) |
| Enable and disable watchdog write-once-only register update. More... | |
| static bool | wdog_hal_is_register_update_enabled (void) |
| Check whether register update is enabled. More... | |
| void | wdog_hal_configure_enabled_in_cpu_debug_mode (bool isEnabled) |
| Set whether watchdog is working while cpu is in debug mode. More... | |
| static bool | wdog_hal_is_cpu_debug_mode_enabled (void) |
| Check whether WDOG works while in CPU debug mode. More... | |
| void | wdog_hal_configure_enabled_in_cpu_stop_mode (bool isEnabled) |
| Set whether watchdog is working while cpu is in stop mode. More... | |
| static bool | wdog_hal_is_cpu_stop_mode_enabled (void) |
| Check whether WDOG works while in CPU stop mode. More... | |
| void | wdog_hal_configure_enabled_in_cpu_wait_mode (bool isEnabled) |
| Set whether watchdog is working while CPU is in wait mode. More... | |
| static bool | wdog_hal_is_cpu_wait_mode_enabled (void) |
| Check whether WDOG works while in CPU wait mode. More... | |
| static bool | wdog_hal_is_interrupt_asserted (void) |
| Get watchdog interrupt status. More... | |
| static void | wdog_hal_clear_interrupt_flag (void) |
| Clear watchdog interrupt flag. More... | |
| static void | wdog_hal_set_timeout_value (uint32_t timeoutCount) |
| set watchdog timeout value. More... | |
| static uint32_t | wdog_hal_get_timeout_value (void) |
| Get watchdog timeout value. More... | |
| static uint32_t | wdog_hal_get_timer_output (void) |
| Get watchdog timer output. More... | |
| static void | wdog_hal_set_clock_prescaler (wdog_clock_prescaler_t clockPrescaler) |
| Set watchdog clock prescaler. More... | |
| static wdog_clock_prescaler_t | wdog_hal_get_clock_prescaler (void) |
| Get watchdog clock prescaler. More... | |
| static void | wdog_hal_set_window_value (uint32_t windowValue) |
| Set watchdog window value. More... | |
| static uint32_t | wdog_hal_get_window_value (void) |
| Get watchdog window value. More... | |
| static void | wdog_hal_unlock (void) |
| Unlock watchdog register written. More... | |
| static void | wdog_hal_refresh (void) |
| Refresh watchdog timer. More... | |
| static void | wdog_hal_reset_chip (void) |
| Reset chip using watchdog. More... | |
| static uint32_t | wdog_hal_get_reset_count (void) |
| Get chip reset count that was reset by watchdog. More... | |
| static void | wdog_hal_clear_reset_count (void) |
| Clear chip reset count that was reset by watchdog. More... | |
| enum wdog_clock_source_t |
| void wdog_hal_enable | ( | void | ) |
This function is used to enable the WDOG and must be called after all necessary configure have been set.
| void wdog_hal_disable | ( | void | ) |
This function is used to disable the WDOG.
|
inlinestatic |
This function is used check whether WDOG is enabled.
| void wdog_hal_configure_interrupt | ( | bool | isEnabled | ) |
This function is used to configure the WDOG interrupt. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| isEnabled | 0 means disable watchdog interrupt. 1 means enable watchdog interrupt. |
|
inlinestatic |
This function is used to check whether the WDOG interrupt is enabled.
| void wdog_hal_set_clock_source | ( | wdog_clock_source_t | clockSource | ) |
This function is used to set the WDOG clock source. There are two clock sources that can be used, the LPO clock and the bus clock. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| clockSource | watchdog clock source, see wdog_clock_source_t. |
|
inlinestatic |
This function is used to get the WDOG clock source. There are two clock sources that can be used, the LPO clock and the bus clock.
| void wdog_hal_configure_window_mode | ( | bool | isEnabled | ) |
This function is used to configure the WDOG window mode. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| isEnabled | 0 means disable watchdog window mode. 1 means enable watchdog window mode. |
|
inlinestatic |
This function is used to check whether the WDOG window mode is enabled.
| void wdog_hal_configure_register_update | ( | bool | isEnabled | ) |
This function is used to configure the WDOG register update feature. If disabled, it means that all WDOG registers will never be written again unless Power On Reset. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| isEnabled | 0 means disable watchdog write-once-only register update. 1 means enable watchdog write-once-only register update. |
|
inlinestatic |
This function is used to check whether the WDOG register update is enabled.
| void wdog_hal_configure_enabled_in_cpu_debug_mode | ( | bool | isEnabled | ) |
This function is used to configure whether the WDOG is enabled in CPU debug mode. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| isEnabled | 0 means watchdog is disabled in CPU debug mode. 1 means watchdog is enabled in CPU debug mode. |
|
inlinestatic |
This function is used to check whether WDOG works in CPU debug mode.
| void wdog_hal_configure_enabled_in_cpu_stop_mode | ( | bool | isEnabled | ) |
This function is used to configure whether the WDOG is enabled in CPU stop mode. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| isEnabled | 0 means watchdog is disabled in CPU stop mode. 1 means watchdog is enabled in CPU stop mode. |
|
inlinestatic |
This function is used to check whether WDOG works in CPU stop mode.
| void wdog_hal_configure_enabled_in_cpu_wait_mode | ( | bool | isEnabled | ) |
This function is used to configure whether the WDOG is enabled in CPU wait mode. The configuration is saved in an internal configure buffer and written back to the register in wdog_hal_enable function, so this function must be called before wdog_hal_enable is called.
| isEnabled | 0 means watchdog is disabled in CPU wait mode. 1 means watchdog is enabled in CPU wait mode. |
|
inlinestatic |
This function is used to check whether WDOG works in CPU wait mode.
|
inlinestatic |
This function is used to get the WDOG interrupt flag.
|
inlinestatic |
This function is used to clear the WDOG interrupt flag.
|
inlinestatic |
This function is used to set the WDOG_TOVAL value.
| timeoutCount | watchdog timeout value, count of watchdog clock tick. |
|
inlinestatic |
This function is used to Get the WDOG_TOVAL value.
|
inlinestatic |
This function is used to get the WDOG_TMROUT value.
|
inlinestatic |
This function is used to set the WDOG clock proscaler.
| clockPrescaler | watchdog clock prescaler, see wdog_clock_prescaler_t. |
|
inlinestatic |
This function is used to get the WDOG clock prescaler.
|
inlinestatic |
This function is used to set the WDOG_WIN value.
| windowValue | watchdog window value. |
|
inlinestatic |
This function is used to Get the WDOG_WIN value.
|
inlinestatic |
This function is used to unlock the WDOG register written. This function must be called before any configuration is set because watchdog register will be locked automatically after a WCT(256 bus cycles).
|
inlinestatic |
This function is used to feed the WDOG. This function should be called before watchdog timer is in timeout, otherwise a RESET will assert.
|
inlinestatic |
This function is used to reset chip using WDOG.
|
inlinestatic |
This function is used to get the value of WDOG_RSTCNT.
|
inlinestatic |
This function is used to clear the WDOG_RSTCNT.